// @ts-ignore
/* eslint-disable */
import request from '@/services/request';

/** 注册用户 POST /v1/users */
export async function userV1ControllerCreate(
  body: API.UserCreateDto,
  options?: { [key: string]: any },
) {
  return request<any>('/v1/users', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 登录 POST /v1/users/login */
export async function userV1ControllerLogin(
  body: API.UserLoginDto,
  options?: { [key: string]: any },
) {
  return request<API.UserLoginResult>('/v1/users/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 登出 POST /v1/users/logout */
export async function userV1ControllerLogout(options?: { [key: string]: any }) {
  return request<any>('/v1/users/logout', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 查询个人详情 GET /v1/users/mine */
export async function userV1ControllerShowMine(options?: { [key: string]: any }) {
  return request<API.UserShowMineResult>('/v1/users/mine', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 更新个人信息 PATCH /v1/users/mine */
export async function userV1ControllerUpdateMine(
  body: API.UserUpdateDto,
  options?: { [key: string]: any },
) {
  return request<any>('/v1/users/mine', {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新密码 PUT /v1/users/mine/password */
export async function userV1ControllerUpdateMinePassword(
  body: API.UserUpdatePasswordDto,
  options?: { [key: string]: any },
) {
  return request<any>('/v1/users/mine/password', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 忘记密码 POST /v1/users/reset-password */
export async function userV1ControllerResetPassword(
  body: API.UserResetPasswordDto,
  options?: { [key: string]: any },
) {
  return request<any>('/v1/users/reset-password', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 校验用户名、邮箱是否重复 GET /v1/users/verify-register */
export async function userV1ControllerVerifyRegister(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.UserV1ControllerVerifyRegisterParams,
  options?: { [key: string]: any },
) {
  return request<API.UserVerifyRegisterResult>('/v1/users/verify-register', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
